package com.example.imagehost.bean;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@PropertySource(value = "classpath:application.yml")
@Component
@ConfigurationProperties(prefix = "server")

public class ServerProperties {
    private Integer port;

    public ServerProperties(){
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public ServerProperties(Integer port){
        this.port = port;
    }

    @Override
    public String toString(){
        return "port: "+port.toString();
    }
}


